home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / MPW IIGS Interfaces / CIIGSIncludes / MIDI.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-03  |  5.9 KB  |  117 lines  |  [TEXT/MPS ]

  1. /********************************************
  2. ; File: MIDI.h
  3. ;
  4. ;
  5. ; Copyright Apple Computer, Inc.1986-90
  6. ; All Rights Reserved
  7. ;
  8. ********************************************/
  9. #ifndef __TYPES__
  10. #include <TYPES.h>
  11. #endif
  12.  
  13. #ifndef __MIDI__
  14. #define __MIDI__
  15.  
  16.  
  17. /* MIDI */
  18. #define miToolNum 0x0020  /* the tool number of the MIDI Tool Set */
  19. #define miDrvrFileType 0x00BB  /* filetype of MIDI device driver */
  20. #define miNSVer 0x0102  /* minimum version of Note Synthesizer required by MIDI Tool Set */
  21. #define miSTVer 0x0203  /* minimum version of Sound Tools needed by MIDI Tool Set */
  22. #define miDrvrAuxType 0x0300  /* aux type of MIDI device driver */
  23.  
  24. /* Error Codes */
  25. #define miStartUpErr 0x2000  /* MIDI Tool Set is not started  */
  26. #define miPacketErr 0x2001  /* incorrect length for a received MIDI command */
  27. #define miArrayErr 0x2002  /* a designated array had an insufficient or illegal size */
  28. #define miFullBufErr 0x2003  /* input buffer overflow */
  29. #define miToolsErr 0x2004  /* the required tools were not started up or had insufficient versions */
  30. #define miOutOffErr 0x2005  /* MIDI output must first be enabled */
  31. #define miNoBufErr 0x2007  /* no buffer is currently allocated */
  32. #define miDriverErr 0x2008  /* the designated file is not a legal MIDI device driver */
  33. #define miBadFreqErr 0x2009  /* the MIDI clock cannot attain the requested frequency */
  34. #define miClockErr 0x200A  /* the MIDI clock value wrapped to zero */
  35. #define miConflictErr 0x200B  /* conflicting processes for MIDI input */
  36. #define miNoDevErr 0x200C  /* no MIDI device driver loaded */
  37. #define miDevNotAvail 0x2080  /* the requested device is not available */
  38. #define miDevSlotBusy 0x2081  /* requested slot is already in use */
  39. #define miDevBusy 0x2082  /* the requested device is already in use */
  40. #define miDevOverrun 0x2083  /* device overrun by incoming MIDI data */
  41. #define miDevNoConnect 0x2084  /* no connection to MIDI */
  42. #define miDevReadErr 0x2085  /* framing error in received MIDI data */
  43. #define miDevVersion 0x2086  /* ROM version is incompatible with device driver */
  44. #define miDevIntHndlr 0x2087  /* conflicting interrupt handler is installed */
  45.  
  46. /* MidiClock */
  47. #define miSetClock 0x0000  /* set time stamp clock */
  48. #define miStartClock 0x0001  /* start time stamp clock */
  49. #define miStopClock 0x0002  /* stop time stamp clock */
  50. #define miSetFreq 0x0003  /* set clock frequency */
  51.  
  52. /* MidiControl */
  53. #define miRawMode 0x00000000L  /* raw mode for MIDI input and output */
  54. #define miSetRTVec 0x0000  /* set real-time message vector */
  55. #define miPacketMode 0x00000001L  /* packet mode for MIDI input and output */
  56. #define miSetErrVec 0x0001  /* set real-time error vector */
  57. #define miStandardMode 0x00000002L  /* standard mode for MIDI input and output */
  58. #define miSetInBuf 0x0002  /* set input buffer information */
  59. #define miSetOutBuf 0x0003  /* set output buffer information */
  60. #define miStartInput 0x0004  /* start MIDI input */
  61. #define miStartOutput 0x0005  /* start MIDI output */
  62. #define miStopInput 0x0006  /* stop MIDI input */
  63. #define miStopOutput 0x0007  /* stop MIDI output */
  64. #define miFlushInput 0x0008  /* discard contents of input buffer */
  65. #define miFlushOutput 0x0009  /* discard contents of output buffer */
  66. #define miFlushPacket 0x000A  /* discard next input packet */
  67. #define miWaitOutput 0x000B  /* wait for output buffer to empty */
  68. #define miSetInMode 0x000C  /* set input mode */
  69. #define miSetOutMode 0x000D  /* set output mode */
  70. #define miClrNotePad 0x000E  /* clear all notes marked on in the note pad */
  71. #define miSetDelay 0x000F  /* set minimum delay between output packets */
  72. #define miOutputStat 0x0010  /* enable/disable output of running-status */
  73. #define miIgnoreSysEx 0x0011  /* ignore system exclusive input */
  74.  
  75. /* MidiDevice */
  76. #define miSelectDrvr 0x0000  /* display device driver selection dialog */
  77. #define miLoadDrvr 0x0001  /* load and initialize device driver */
  78. #define miUnloadDrvr 0x0002  /* shutdown MIDI device, unload driver */
  79.  
  80. /* MidiInfo */
  81. #define miNextPktLen 0x0000  /* return length of next packet */
  82. #define miInputChars 0x0001  /* return number of characters in input buffer */
  83. #define miOutputChars 0x0002  /* return number of characters in output buffer */
  84. #define miMaxInChars 0x0003  /* return maximum number of characters in input buffer */
  85. #define miMaxOutChars 0x0004  /* return maximum number of characters in output buffer */
  86. #define miRecordAddr 0x0005  /* return current MidiRecordSeq address */
  87. #define miPlayAddr 0x0006  /* return current MidiPlaySeq address */
  88. #define miClockValue 0x0007  /* return current time stamp clock value */
  89. #define miClockFreq 0x0008  /* return number of clock ticks per second */
  90. #define midiInputPoll 0x00E101B2L /* MidiInputChannel - vector to poll MIDI input channel */
  91.  
  92. struct MiBufInfo {
  93.    Word bufSize; /* size of buffer (0 for default) */
  94.    Pointer address; /* address of buffer (0 for auto-allocation) */
  95. } ;
  96. typedef struct MiBufInfo MiBufInfo;
  97. struct MiDriverInfo {
  98.    Word slot; /* device slot */
  99.    Word external; /* slot internal (=0) / external (=1) */
  100.    Byte pathname[65]; /* device driver pathname */
  101. } ;
  102. typedef struct MiDriverInfo MiDriverInfo, *MiDriverInfoPtr;
  103. extern pascal void MidiBootInit() inline(0x0120,dispatcher);
  104. extern pascal void MidiClock() inline(0x0B20,dispatcher);
  105. extern pascal void MidiControl() inline(0x0920,dispatcher);
  106. extern pascal void MidiDevice() inline(0x0A20,dispatcher);
  107. extern pascal LongWord MidiInfo() inline(0x0C20,dispatcher);
  108. #define MidiInputPoll() asm { jsl 0xE11DD8} /* Not a true tool call. Made through its own vector */
  109. extern pascal Word MidiReadPacket() inline(0x0D20,dispatcher);
  110. extern pascal void MidiReset() inline(0x0520,dispatcher);
  111. extern pascal void MidiShutDown() inline(0x0320,dispatcher);
  112. extern pascal void MidiStartUp() inline(0x0220,dispatcher);
  113. extern pascal Boolean MidiStatus() inline(0x0620,dispatcher);
  114. extern pascal Word MidiVersion() inline(0x0420,dispatcher);
  115. extern pascal Word MidiWritePacket() inline(0x0E20,dispatcher);
  116. #endif
  117.